package com.huluobo.base.net

import com.huluobo.base.bean.CartBean
import com.huluobo.base.bean.CommentBean
import com.huluobo.base.bean.GiftBean
import com.huluobo.base.bean.GoodsBean
import com.huluobo.base.bean.UserBean
import com.huluobo.base.bean.VideoBean
import okhttp3.RequestBody
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.Query

/**
 *  Created by LC on 2024/11/27.
 */
interface ApiService {
    @POST(Const.URL_LOGIN)
    suspend fun login(@Body body: RequestBody): Res<UserBean>

    @GET(Const.URL_VIDEOS)
    suspend fun getVideos(
        @Query(Const.PARAM_CURRENT_PAGE) currentPage: Int,
        @Query(Const.PARAM_PAGE_SIZE) pageSize: Int
    ): Res<List<VideoBean>>

    @POST(Const.URL_LIKE_VIDEO)
    suspend fun likeVideo(@Query(Const.PARAM_VIDEO_ID) videoId: Int): Res<String>

    @POST(Const.URL_NO_LIKE_VIDEO)
    suspend fun noLikeVideo(@Query(Const.PARAM_VIDEO_ID) videoId: Int): Res<String>

    @POST(Const.URL_FOLLOW_AUTH)
    suspend fun followAuth(@Body body: RequestBody): Res<String>

    @GET(Const.URL_GET_COMMENT_BY_ID)
    suspend fun getCommentById(@Query(Const.PARAM_VIDEO_ID) videoId: Int): Res<List<CommentBean>>

    @POST(Const.URL_SEND_COMMENT)
    suspend fun sendComment(@Body body: RequestBody): Res<List<CommentBean>>

    @POST(Const.URL_CANCEL_FOLLOW)
    suspend fun cancelFollow(@Body body: RequestBody): Res<String>

    @GET(Const.URL_GET_GIFT)
    suspend fun getGift(): Res<List<GiftBean>>

    @GET(Const.URL_GET_GOODS)
    suspend fun getGoods(
        @Query(Const.PARAM_CATEGORY_ID) categoryId: Int,
        @Query(Const.PARAM_CURRENT_PAGE) currentPage: Int,
        @Query(Const.PARAM_PAGE_SIZE) pageSize: Int
    ): Res<List<GoodsBean>>

    @GET(Const.URL_GOODS_DETAIL)
    suspend fun getGoodsDetail(@Query(Const.PARAM_GOODS_ID) goodsId: Int): Res<GoodsBean>

    @POST(Const.URL_ADD_TO_CART)
    suspend fun addToCart(@Body body: RequestBody): Res<String>

    @GET(Const.URL_GET_CART)
    suspend fun getCart(): Res<List<CartBean>>

    @POST(Const.URL_DELETE_CART)
    suspend fun deleteCart(@Body body: RequestBody): Res<String>

}